package weekMatch.one_341;

import java.util.Map;

public class LeeCode_02 {
    public static void main(String[] args) {

    }
    public int maxDivScore(int[] nums, int[] divisors) {
        int maxC = 0;
        int maxN = divisors[0];
        for (int divisor : divisors) {
            int count = 0;
            for (int num : nums) {
                if (num % divisor == 0) {
                    count++;
                }
            }
            if (count > maxC) {
                maxC = count;
                maxN = divisor;
            } else if (count == maxC) {
                if (divisor < maxN) {
                    maxN = divisor;
                }
            }
        }
        return maxN;
    }
}
